package com.wc.acwing_sunday.数学知识.组合数.序列数量;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/4/13 22:41
 * @description https://www.acwing.com/problem/content/5571/
 */
public class Main {
    static Scanner sc = new Scanner(System.in);
    static int n, m;
    static int P = (int) 1e6 + 3;

    // 思路： 1 <= a[1] + a[2] + ... + a[m] <= n
    //      => a[1] + a[2] + ... + a[m] + a[m + 1] = n
    //      => 0 <= a[m+1] <= n - 1
    //      => 当a[m+1] = n时， a[1] = a[2] = ... = a[m] = 0
    //      => 所以 0 <= a[i] <= n时候
    //      => b[i] = a[i] + 1, b是正整数，使用隔板法
    //      => b[1] + b[2] + ... + b[m + 1] = n + m + 1;
    //      => 一共有n + m + 1个数, 有 n + m 个缝隙, 有 m 个板子, 所以 C(n + m, m)
    //      => res = C(n + m, m) - 1
    public static void main(String[] args) {
        n = sc.nextInt();
        m = sc.nextInt();
        long res = 1;
        for (int i = n + m, j = 1; j <= m; i--, j++) {
            res = res * i % P;
            res = res * qkm(j, P - 2, P);
        }
        System.out.println((res - 1 + P) % P);
    }

    static long qkm(long a, int b, int p) {
        long res = 1 % p;
        while (b > 0) {
            if ((b & 1) == 1) res = res * a % p;
            a = a * a % p;
            b >>= 1;
        }
        return res;
    }
}
